public class Text {

    static class TreeNode{
        public int val;
        public TreeNode left;
        public TreeNode right;
        public TreeNode prev;

        public TreeNode(int val) {
            this.val = val;
        }
    }

    TreeNode prev= null;
    TreeNode root=null;
    public void ConvertChild(TreeNode cur) {
        if(cur == null){
            return;
        }
        ConvertChild(cur.left);
        if(prev == null){
            root = cur;
        }else {
            prev.right = cur;
        }
        cur.left = prev;
        prev = cur;
        ConvertChild(cur.right);
    }





        public static void main(String[] args) {

    }
}
